<!DOCTYPE html">
<html>
<head>
<title>实施过程</title>
<meta http-equiv="content-type" content="textml; charset=utf-8" />
<meta name="description" content="__DESCRIPTION__">
<meta name="keywords" content="__KEYWORDS__">
<link href="__CSS__/common.css" rel="stylesheet" type="text/css">
<link href="__CSS__/Version4Master.css" rel="stylesheet" type="text/css">
<link href="__CSS__/setting.css" rel="stylesheet" type="text/css">
<link href="__CSS__/account.css" rel="stylesheet" type="text/css">
<link href="__CSS__/thickbox.css" rel="stylesheet" type="text/css">
<link href="__CSS__/addproject.css" rel="stylesheet" type="text/css">
<link href="__CSS__/validator.css" rel="stylesheet" type="text/css">
<script src="__JS__/jquery-1.8.2.js" type="text/javascript"></script>
<script src="__JS__/formValidator-4.0.1.js" type="text/javascript" charset="UTF-8"></script>
<script src="__JS__/ValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<script src="__JS__/DateTimeMask.js" type="text/javascript" charset="UTF-8"></script>
</head>
<body>
  <div id="container">
	<!--header文件 start -->
	<include file="./Match/Tpl/Include/header.html" />
	<!--header文件 stop -->
    <div class="clear"> </div>
    <div id="container_content">
      <div class="topic_nav_block_wrapper">
        	<ul class="topic_nav_block">
							<li><a href="__URL__/showMatch/id/{$Think.get.id}">商业实践项目</a> </li>
							<li><a href="__URL__/modProject/id/{$Think.get.id}">方案展示</a></li>
							<li><a href="__URL__/modTheme/id/{$Think.get.id}">参赛主题</a> </li>
							<li><a href="__URL__/uploadProjectFile/id/{$Think.get.id}">详细方案</a> </li>
							<li><a class="current_nav"href="__URL__/addWorks/id/{$Think.get.id}">实践作品展示</a></li>
							<li style=" float:right;"><a class="teamnav" href="__APP__/Team/Home/index/id/{$Think.get.id}">返回团队主页</a></li>
						</ul>
        <div class="clear"> </div>
      </div>
	    <form name="aspnetForm" method="post" action="__URL__/doaddWorks" id="aspnetForm">
      	<input type="hidden" name="id" value="{$Think.get.id}" />
			<div class="edit_item" >
      		<table width="600" style="border-collapse:collapse" cellspacing="0" cellpadding="0"  >
				<tr>
					<th>作品ID</th><th>作品名称</th><th>工具平台</th><th>作品链接</th><th>客观数据</th><th>编辑</th><th>删除</th>
				</tr>
				<volist name="works" id="vo">
  				<tr style="height:20px;" align="center">
  					<td style="color:red;" width="70"><span style="color:red">{$vo.Id}</span></td>
  					<td width="100" style="color:#hhh;">{$vo.Name}</td>
  					<td width="100" style="color:#hhh;">{$vo.Platform}</td>
  					<td width="150"	style="color:#hhh; text-align:left;" ><a href="{$vo.Url}">{$vo.Url|substr=0,20}...</a></td>
					<td width="100" style="color:#hhh;">{$vo.Description}</td>
  					<td >
						<a ajaxaction="EditaddWorks/id/{$vo.Id}" title="编辑" >编辑</a>
					</td>
					<td>
						<span class="delworks" val="{$vo.Id}" title="删除"  style="cursor:pointer;color:red;"> 删除 </span>
  					</td>
				</tr>
				</volist>
      		</table>
		</div>
      <h3 style="color:red;">提交新的作品</h3>
    
      <div id="editorHolder" style="border: 1px dotted #ddd; border-top: none;">
   		 	<div class="edit_item" >
				<label class="legend">*作品名称：</label>
				<input name="Titles" type="text" id="Titles" class="inupt_text" maxlength="10">
				<span id="TitlesTip"></span>
			</div>
			<div class="edit_item">
				<label class="legend">*工具平台：</label>
				<input name="Platforms" type="text" id="Platforms" class="inupt_text">
				<span id="PlatformsTip" class="onShow">选择工具平台</span>
			</div>
            <div class="edit_item">
                <label class="legend">&nbsp;&nbsp;作品链接：</label>
                <input name="URL" type="text" id="URL" class="inupt_text">
                <span id="URLTip" class="onShow">请在网址前面添加http://;如:http://www.taobao.com</span>
            </div>
            <div class="edit_item">
                <label class="legend">&nbsp;&nbsp;客观数据：</label>
                <input name="Data" id="Data" class="inupt_text" type="text">
                <span id="DataTip"></span>
            </div>
        	<div class="save_block">
	          <input name="Submit" value="保存" id="Submit" class="btn_blue" type="submit">
          	<div style="height: 3em; line-height: 3em;" class="text_red"> </div>
        </div>
      </div>
  	</form>
    </div>
    <div class="clear"> </div>
	<!--footer文件 start -->
	<include file="./Match/Tpl/Include/footer.html" />
	<!--footer文件 end -->
  </div>

<include file="./Match/Tpl/Include/ajaxloadhtml.html" />
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formID:"aspnetForm",autoTip:false,onError:function(msg){alert(msg)},inIframe:true});
	
	$("#Titles").formValidator({onShow:"请输入作品名称！",onFocus:"一定要写的！",onCorrect:"O(∩_∩)O~",defaultValue:""}).inputValidator({min:1,max:40,onError: "忘记选择了?"});
	$("#Data").formValidator({onShow:"请输入作品名称！",onFocus:"一定要写的！",onCorrect:"O(∩_∩)O~",defaultValue:""}).inputValidator({min:1,max:40,onError: "忘记选择了?"});
	$("#Platforms").formValidator({onShow:"请选择工具平台！",onFocus:"如果没有列出，可自行填写工具！",onCorrect:"O(∩_∩)O~",defaultValue:""}).inputValidator({min:1,max:40,onError: "不选就认定QQ了啊!"}).functionValidator({

					fun: function (val, elem) {
						var result = false;
						$("#ctl00_ContentPlaceHolder1_CheckBoxList1>input[type=\"checkbox\"]").each(function () {
							result = result || $(this).attr("checked")

						});
						if (val != "" || result) {
							return true;
						} else {
							return "必须选择或填写自己方案使用的工具平台";
						}
					}
				});;
	$("#URL").formValidator({onShow:"如:http://www.taobao.com",onFocus:"如：http://www.taobao.com",onCorrect:"O(∩_∩)O~"}).inputValidator({min:6,max:100,onError:"您输入的链接不合法(⊙o⊙),请确认"}).regexValidator({regExp:"url",dataType:"enum",onError:"你输入的网址不正确"});
});
</script>
<script type="text/javascript">
    var funnum=0;
    function uploadCallBack(filename,oldname){
        if(filename==false){
            alert("文件上传失败,请重新上传");
            $(".load_body").load("__URL__/UpLoadAttachFiles");
        }else{
            document.getElementById("toupfile").innerHTML+='<a href="__UPFILE__/Doc/UploadFile/'+filename+'" target="_blank">'+oldname+'</a>;';
            document.getElementById("upres").innerHTML='文件'+oldname+'上传完毕,你可以继续选择文件上传<br />';
            document.getElementById("upfileval").value+=' '+filename+'; ';
			$('.newadd').html($('.newadd').html()+'<span class="toupfile" >'+oldname+'</span>&nbsp;&nbsp;&nbsp;&nbsp;<input type="hidden" size="100" name="toupfile" id="upfileval" value="'+filename+'"/><span class="delfile" val="'+filename+'" title="删 除"  style="cursor:pointer;color:red;"> X </span><br />');

            funnum++;
            if(funnum>=3){
                document.getElementById("add").parentNode.removeChild(document.getElementById("add"));
                document.getElementById("ajaxloadhtml").parentNode.removeChild(document.getElementById("ajaxloadhtml"));
            }
        }
    }
	$(function(){
		$('.delworks').click(function(){
			var isdel=confirm('您确定要删除吗？');
			if(isdel){
				var val=$(this).attr("val");
				obj=$(this);
				$.ajax({
					type: "POST",
					url: "__URL__/delworks",
					data: "fileid="+val,
					success: function(msg){
						obj.parent().parent().remove();
					}
				});
			}

		});
	});
</script>
</body>

</html>
